<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:aw="clr-namespace:Assergs.Windows"
	xmlns:awc="clr-namespace:Assergs.Windows.Controls"
	>
    
    <Style x:Key="ButtonFocusVisualStyle">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Border
						CornerRadius="2.5"
						BorderBrush="#F6CF57"
						BorderThickness="2"	/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <SolidColorBrush x:Key="ForegroundColorBrush" Color="{x:Static aw:ImageButtonDefaultStylePallet.ForegroundColor}"/>
    <SolidColorBrush x:Key="NormalBorderBrush" Color="{x:Static aw:ImageButtonDefaultStylePallet.NormalBorder}"></SolidColorBrush>
    <SolidColorBrush x:Key="LightBorderBrush" Color="{x:Static aw:ImageButtonDefaultStylePallet.LightBorder}"/>
    <SolidColorBrush x:Key="PlusLightBorderBrush" Color="{x:Static aw:ImageButtonDefaultStylePallet.PlusLightBorder}"/>
    <SolidColorBrush x:Key="DisabledBorderBrush" Color="{x:Static aw:ImageButtonDefaultStylePallet.DisabledBorder}"/>
    <SolidColorBrush x:Key="DisabledForegroundBrush" Color="{x:Static aw:ImageButtonDefaultStylePallet.DisabledForeground}"/>
    
    <LinearGradientBrush x:Key="NormalBackGroundBrush" StartPoint="0.5,0" EndPoint="0.5,1">
		<GradientStop Color="{x:Static aw:ImageButtonDefaultStylePallet.NormalBackGround1}" Offset="0"/>
        <GradientStop Color="{x:Static aw:ImageButtonDefaultStylePallet.NormalBackGround2}" Offset="0.4"/>
        <GradientStop Color="{x:Static aw:ImageButtonDefaultStylePallet.NormalBackGround3}" Offset="0.4"/>
        <GradientStop Color="{x:Static aw:ImageButtonDefaultStylePallet.NormalBackGround4}" Offset="1"/>
	</LinearGradientBrush>
		    
    <LinearGradientBrush x:Key="LightBackGroundBrush" StartPoint="0.5,0" EndPoint="0.5,1">
		<GradientStop Offset="0" Color="{x:Static aw:ImageButtonDefaultStylePallet.DefaultControlMouseOver1}" />
		<GradientStop Offset="0.4" Color="{x:Static aw:ImageButtonDefaultStylePallet.DefaultControlMouseOver2}" />
		<GradientStop Offset="0.4" Color="{x:Static aw:ImageButtonDefaultStylePallet.DefaultControlMouseOver3}" />
		<GradientStop Offset="1" Color="{x:Static aw:ImageButtonDefaultStylePallet.DefaultControlMouseOver4}" />
	</LinearGradientBrush>
    
    <LinearGradientBrush x:Key="PlusLightBackGroundBrush" StartPoint="0.5,0" EndPoint="0.5,1">
		<GradientStop Offset="0" Color="{x:Static aw:ImageButtonDefaultStylePallet.DefaultControlPressed1}" />
		<GradientStop Offset="0.1" Color="{x:Static aw:ImageButtonDefaultStylePallet.DefaultControlPressed2}" />
		<GradientStop Offset="0.4" Color="{x:Static aw:ImageButtonDefaultStylePallet.DefaultControlPressed3}" />
		<GradientStop Offset="0.4" Color="{x:Static aw:ImageButtonDefaultStylePallet.DefaultControlPressed4}" />
		<GradientStop Offset="1" Color="{x:Static aw:ImageButtonDefaultStylePallet.DefaultControlPressed5}" />
	</LinearGradientBrush>
    
    <LinearGradientBrush x:Key="DisableBackGroundBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="{x:Static aw:ImageButtonDefaultStylePallet.DisableBackGround1}"></GradientStop>
        <GradientStop Color="{x:Static aw:ImageButtonDefaultStylePallet.DisableBackGround2}"></GradientStop>
    </LinearGradientBrush>

    <Style x:Key="{x:Type awc:ReflectedButton}" TargetType="{x:Type awc:ReflectedButton}" >
		<Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisualStyle}" />
        <Setter Property="MaxWidth" Value="80" />
        <Setter Property="Width" Value="80" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type awc:ReflectedButton}"> 
					
					<Grid>
																
						<StackPanel>
						
							<Border Name="ReflectedElement" BorderThickness="1" CornerRadius="2">
								<ContentPresenter />
							</Border>
							
							<TextBlock 
								HorizontalAlignment="Center"
								VerticalAlignment="Center"
								Margin="0"
								TextWrapping="NoWrap"
								TextTrimming="CharacterEllipsis"
								Text="{TemplateBinding Text}" />
																						
							<Rectangle Visibility="Collapsed"
								Name="ReflectionRect" 
								Height="{Binding Path=ActualHeight, ElementName=ReflectedElement}" 
								Width="{Binding Path=ActualWidth, ElementName=ReflectedElement}">
								<Rectangle.Fill>
									<VisualBrush 
										Opacity="0.75" Stretch="None"
										Visual="{Binding ElementName=ReflectedElement}">
										<VisualBrush.RelativeTransform>
											<TransformGroup>
												<ScaleTransform ScaleX="1" ScaleY="-1" />
												<TranslateTransform  Y="1" />
											</TransformGroup>
										</VisualBrush.RelativeTransform>
									</VisualBrush>
								</Rectangle.Fill>

								<Rectangle.OpacityMask>
									<LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
										<GradientStop Color="#FF000000" Offset="0.0" />
										<GradientStop Color="#33000000" Offset="0.5" />
										<GradientStop Color="#00000000" Offset="0.75" />
									</LinearGradientBrush>
								</Rectangle.OpacityMask>
							</Rectangle>

						</StackPanel>
						
						
					
					</Grid>																	
					
					<ControlTemplate.Triggers>
					
						<Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="ReflectedElement" Property="Background" Value="{StaticResource LightBackGroundBrush}" />
                            <Setter TargetName="ReflectedElement" Property="BorderBrush" Value="{StaticResource LightBorderBrush}" />
                        </Trigger>

                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="ReflectedElement" Property="Background" Value="{StaticResource PlusLightBackGroundBrush}" />
                            <Setter TargetName="ReflectedElement" Property="BorderBrush" Value="{StaticResource PlusLightBorderBrush}"/>
                        </Trigger>
					
					</ControlTemplate.Triggers>
					
                </ControlTemplate>
            </Setter.Value>
        </Setter>

    </Style>

</ResourceDictionary>